17d9e6
@@ -3955,20 +3955,15 @@
private int truncateTable(Hive db, TruncateTableDesc truncateTableDesc) throws H
 
     Table table = db.getTable(tableName, true);
 
-    FsShell fshell = new FsShell(conf);
     try {
+      // this is not transactional
       for (Path location : getLocations(db, table, partSpec)) {
-        fshell.run(new String[]{"-rmr", location.toString()});
-        location.getFileSystem(conf).mkdirs(location);
+        FileSystem fs = location.getFileSystem(conf);
+        fs.delete(location, true);
+        fs.mkdirs(location);
       }
     } catch (Exception e) {
       throw new HiveException(e);
-    } finally {
-      try {
-        fshell.close();
-      } catch (IOException e) {
-        // ignore
-      }
     }
     return 0;
   }
